home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / apuzzle / pform2.frm < prev    next >
Text File  |  1999-09-27  |  10KB  |  319 lines

  1. VERSION 5.00
  2. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
  3. Begin VB.Form PForm2 
  4.    Caption         =   "Form1"
  5.    ClientHeight    =   4560
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   6270
  9.    ControlBox      =   0   'False
  10.    LinkTopic       =   "Form1"
  11.    Moveable        =   0   'False
  12.    ScaleHeight     =   4560
  13.    ScaleWidth      =   6270
  14.    StartUpPosition =   1  'CenterOwner
  15.    Begin VB.Frame Frame3 
  16.       Caption         =   "Pieces"
  17.       BeginProperty Font 
  18.          Name            =   "MS Sans Serif"
  19.          Size            =   12
  20.          Charset         =   0
  21.          Weight          =   700
  22.          Underline       =   0   'False
  23.          Italic          =   0   'False
  24.          Strikethrough   =   0   'False
  25.       EndProperty
  26.       Height          =   1365
  27.       Left            =   2115
  28.       TabIndex        =   4
  29.       Top             =   3060
  30.       Width           =   1995
  31.       Begin VB.OptionButton Option1 
  32.          Caption         =   "35 (7  X 5)"
  33.          Height          =   240
  34.          Index           =   3
  35.          Left            =   180
  36.          TabIndex        =   11
  37.          Top             =   270
  38.          Width           =   1500
  39.       End
  40.       Begin VB.OptionButton Option1 
  41.          Caption         =   "48 (8 X 6)"
  42.          Height          =   240
  43.          Index           =   0
  44.          Left            =   180
  45.          TabIndex        =   7
  46.          Top             =   540
  47.          Width           =   1500
  48.       End
  49.       Begin VB.OptionButton Option1 
  50.          Caption         =   "80 (10 X 8)"
  51.          Height          =   240
  52.          Index           =   1
  53.          Left            =   180
  54.          TabIndex        =   6
  55.          Top             =   810
  56.          Width           =   1500
  57.       End
  58.       Begin VB.OptionButton Option1 
  59.          Caption         =   "120 (12  X 10)"
  60.          Height          =   240
  61.          Index           =   2
  62.          Left            =   180
  63.          TabIndex        =   5
  64.          Top             =   1080
  65.          Width           =   1500
  66.       End
  67.    End
  68.    Begin VB.Frame Frame1 
  69.       Caption         =   "Picture"
  70.       BeginProperty Font 
  71.          Name            =   "MS Sans Serif"
  72.          Size            =   12
  73.          Charset         =   0
  74.          Weight          =   700
  75.          Underline       =   0   'False
  76.          Italic          =   0   'False
  77.          Strikethrough   =   0   'False
  78.       EndProperty
  79.       Height          =   3030
  80.       Left            =   2115
  81.       TabIndex        =   3
  82.       Top             =   0
  83.       Width           =   4065
  84.       Begin VB.Frame Frame2 
  85.          Height          =   1230
  86.          Left            =   0
  87.          TabIndex        =   8
  88.          Top             =   855
  89.          Visible         =   0   'False
  90.          Width           =   4065
  91.          Begin ComctlLib.ProgressBar PBar1 
  92.             Height          =   150
  93.             Left            =   135
  94.             TabIndex        =   10
  95.             Top             =   900
  96.             Width           =   3750
  97.             _ExtentX        =   6615
  98.             _ExtentY        =   265
  99.             _Version        =   327682
  100.             Appearance      =   0
  101.          End
  102.          Begin VB.Label Label1 
  103.             Alignment       =   2  'Center
  104.             BorderStyle     =   1  'Fixed Single
  105.             Caption         =   "Making the puzzle"
  106.             BeginProperty Font 
  107.                Name            =   "MS Sans Serif"
  108.                Size            =   13.5
  109.                Charset         =   0
  110.                Weight          =   700
  111.                Underline       =   0   'False
  112.                Italic          =   0   'False
  113.                Strikethrough   =   0   'False
  114.             EndProperty
  115.             ForeColor       =   &H00FF0000&
  116.             Height          =   420
  117.             Left            =   135
  118.             TabIndex        =   9
  119.             Top             =   225
  120.             Width           =   3795
  121.          End
  122.       End
  123.       Begin VB.Image Image1 
  124.          Height          =   2500
  125.          Left            =   270
  126.          Stretch         =   -1  'True
  127.          Top             =   315
  128.          Width           =   3500
  129.       End
  130.    End
  131.    Begin VB.CommandButton Command2 
  132.       Caption         =   "EXIT"
  133.       BeginProperty Font 
  134.          Name            =   "Tahoma"
  135.          Size            =   12
  136.          Charset         =   0
  137.          Weight          =   700
  138.          Underline       =   0   'False
  139.          Italic          =   0   'False
  140.          Strikethrough   =   0   'False
  141.       EndProperty
  142.       Height          =   375
  143.       Left            =   4905
  144.       TabIndex        =   2
  145.       Top             =   3825
  146.       Width           =   1050
  147.    End
  148.    Begin VB.CommandButton Command1 
  149.       Caption         =   "OK"
  150.       BeginProperty Font 
  151.          Name            =   "Tahoma"
  152.          Size            =   12
  153.          Charset         =   0
  154.          Weight          =   700
  155.          Underline       =   0   'False
  156.          Italic          =   0   'False
  157.          Strikethrough   =   0   'False
  158.       EndProperty
  159.       Height          =   375
  160.       Left            =   4905
  161.       TabIndex        =   1
  162.       Top             =   3285
  163.       Width           =   1050
  164.    End
  165.    Begin VB.FileListBox File1 
  166.       Height          =   4185
  167.       Left            =   45
  168.       TabIndex        =   0
  169.       Top             =   90
  170.       Width           =   1995
  171.    End
  172. End
  173. Attribute VB_Name = "PForm2"
  174. Attribute VB_GlobalNameSpace = False
  175. Attribute VB_Creatable = False
  176. Attribute VB_PredeclaredId = True
  177. Attribute VB_Exposed = False
  178. Option Explicit
  179. Private Sub Command1_Click()
  180. If clickbit = 0 Then Exit Sub
  181. Frame2.Visible = True
  182. DoEvents
  183. '---------------------
  184. frmMain.Pic1(0).Visible = False
  185. If Pieces > 2 Then
  186. PBar1.Min = 1: PBar1.Max = Pieces - 1
  187. For xx = 1 To Pieces - 1
  188. Unload frmMain.Pic1(xx)
  189. PBar1.Value = xx
  190. Next xx
  191. End If
  192. PBar1.Min = 0: PBar1.Max = 119
  193. For xx = 0 To 119
  194. PForm3.Pic1(xx).Visible = False
  195. PBar1.Value = xx
  196. Next xx
  197. '----------------------
  198. frmMain.PicClip1.Picture = LoadPicture(PicNam)
  199. PicWidth = frmMain.PicClip1.Width
  200. PicHeight = frmMain.PicClip1.Height
  201. If Option1(0).Value = True Then
  202. Pieces = 48
  203. frmMain.PicClip1.Cols = 8: frmMain.PicClip1.Rows = 6
  204. frmMain.Grid1.Cols = 8: frmMain.Grid1.Rows = 6
  205. GrCol = 8: GrRow = 6
  206. End If
  207. If Option1(1).Value = True Then
  208. Pieces = 80
  209. frmMain.PicClip1.Cols = 10: frmMain.PicClip1.Rows = 8
  210. frmMain.Grid1.Cols = 10: frmMain.Grid1.Rows = 8
  211. GrCol = 10: GrRow = 8
  212. End If
  213. If Option1(2).Value = True Then
  214. Pieces = 120
  215. frmMain.PicClip1.Cols = 12: frmMain.PicClip1.Rows = 10
  216. frmMain.Grid1.Cols = 12: frmMain.Grid1.Rows = 10
  217. GrCol = 12: GrRow = 10
  218. End If
  219. If Option1(3).Value = True Then
  220. Pieces = 35
  221. frmMain.PicClip1.Cols = 7: frmMain.PicClip1.Rows = 5
  222. frmMain.Grid1.Cols = 7: frmMain.Grid1.Rows = 5
  223. GrCol = 7: GrRow = 5
  224. End If
  225. For t = 1 To Pieces - 1
  226. PBar1.Min = 1: PBar1.Max = Pieces - 1
  227. Load frmMain.Pic1(t)
  228. Randomize
  229. frmMain.Pic1(t).Left = Int((Rnd * 700) + 25)
  230. Randomize
  231. frmMain.Pic1(t).Top = Int((Rnd * 450) + 50)
  232. frmMain.Pic1(t).ZOrder 0
  233. PBar1.Value = t
  234. Next t
  235. Randomize
  236. frmMain.Pic1(0).Left = Int((Rnd * 700) + 25)
  237. Randomize
  238. frmMain.Pic1(0).Top = Int((Rnd * 450) + 50)
  239. frmMain.Pic1(0).ZOrder 0
  240.  
  241. PBar1.Min = 0: PBar1.Max = Pieces - 1
  242. For t = 0 To Pieces - 1
  243. frmMain.Pic1(t).Picture = frmMain.PicClip1.GraphicCell(t)
  244. frmMain.Pic1(t).Visible = True
  245. PBar1.Value = t
  246. Next t
  247. '------------------------------
  248. For xx = 0 To GrCol - 1 'corners x
  249. GrCorX(xx) = (xx * frmMain.Pic1(0).Width) + 13 + (frmMain.Pic1(0).Width / 2)
  250. Next xx
  251. For xx = 0 To GrRow - 1
  252. GrCorY(xx) = (xx * frmMain.Pic1(0).Height) + 51 + (frmMain.Pic1(0).Height / 2)
  253. Next xx
  254. '------------------------------
  255. frmMain.Grid1.Width = PicWidth + 2
  256. frmMain.Grid1.Height = PicHeight + 2
  257. frmMain.Grid1.Visible = True
  258. frmMain.Grid1.ZOrder 1
  259. frmMain.Grid1.Top = 10
  260. frmMain.Grid1.Left = 10
  261. For xx = 0 To GrCol - 1
  262. frmMain